<?php

declare (strict_types=1);

namespace app\bbxw\controller;


use think\admin\Controller;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Shared\Date;
use think\admin\Plugin;
use think\admin\service\RuntimeService;
use think\admin\service\SystemService;

/**
 * 系统配置
 * @class Package
 * @package app\bbxw\controller
 */
class Sys extends Controller
{

    /**
     * 绑定数据表
     * @var string
     */
    private $table = 'article';
    /**
     * 系统配置
     * @auth true
     * @menu true
     * @login true
     */
    public function index()
    {

        if ($this->request->isGet()) {
            $this->title = '系统配置';
            $this->fetch("form");
        } else {
            $post = $this->request->post();
            // 数据数据到系统配置表
            foreach ($post as $k => $v) sysconf($k, $v);
            $this->success('数据保存成功！');
        }
    }


}
